package service.impl;

import dao.StaffInfoDao;
import dao.impl.StaffInfoDaoImpl;
import entity.StaffsInfo;
import service.StaffInfoService;

import java.util.List;

/**
 * ClassName: StaffInfoServiceImpl
 * Description:
 *
 * @Author zjl
 * @Create 2025/02/24 20:28
 * @Version 1.0
 */
public class StaffInfoServiceImpl implements StaffInfoService {
    private StaffInfoDao dao = new StaffInfoDaoImpl();


    @Override
    public List<StaffsInfo> list() {
        try {
            return dao.list();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int add(StaffsInfo info) {
        try {
            return dao.update(info);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int update(StaffsInfo info) {
        try {
            return dao.update(info);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }

    @Override
    public int delete(StaffsInfo id) {
        try {
            return dao.update(id);
        } catch (Exception e){
            throw new RuntimeException(e);
        }
    }
}
